/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;
import dao.BinhLuanDAO;
import dao.DienThoaiDAO;
import dao.TaiKhoanDAO;
import java.util.ArrayList;
import pojo.Binhluan;
import pojo.Dienthoai;
import pojo.Taikhoan;

/**
 *
 * @author Minh Tien
 */
public class MainClass 
{

    public static ArrayList<Binhluan> dsbinhluan = null;
    public static Taikhoan taikhoan = null;
    public static Binhluan binhluan = null;
    public static ArrayList<Dienthoai> dsdienthoai = null;
    public static void main(String[] args) 
    {
       BinhLuanDAO bldao = new BinhLuanDAO();
       dsbinhluan= bldao.getBinhLuan(1);
       if(dsbinhluan!= null)
       {
       System.out.print(dsbinhluan.get(0).getBinhluan());
       }
       else
       {
           System.out.println("không có anh sách");
       }
           
       /*dsbinhluan= bldao.getBinhLuan(1);
       if(dsbinhluan.size()!= 0)
       {
        System.out.print(dsbinhluan.get(0).getBinhluan());
       }
       else
       {
           System.out.println(dsbinhluan.size());
       }*/
       
      /*TaiKhoanDAO tkdao = new TaiKhoanDAO();
      taikhoan = tkdao.getTaiKhoanByUsername("tien");
      if(taikhoan != null)
       {
        System.out.print(taikhoan.getHoten());
       }
       else
       {
           System.out.println("không có anh sách");
       }*/
        
        /*DienThoaiDAO dtdao = new DienThoaiDAO();
        dsdienthoai = dtdao.getDienthoaitheogiavahang("12", "no");
        System.out.println(dsdienthoai.size());
       if(dsdienthoai.size()!= 0)
       {
           for(int i=0; i<dsdienthoai.size();i++)
           {
                System.out.println(dsdienthoai.get(i).getTendienthoai());
                System.out.println(dsdienthoai.get(i).getGiaban());
                System.out.println("-------------------------------");
           }
       }
       else
       {
           System.out.println("không có danh sách");
       }*/
        
       /*DienThoaiDAO dtdao = new DienThoaiDAO();

       dsdienthoai = dtdao.getDienthoaitheonhieutieuchi("aac", "8.0", "li-ion", "16", "sdfa", "sdf");
       if(dsdienthoai==null )
       {
           System.out.println("ko thể lấy danh sách");
       }
       else
       {
            System.out.println(dsdienthoai.size());
            if(dsdienthoai.size()!= 0)
            {
                for(int i=0; i<dsdienthoai.size();i++)
                {
                        System.out.println(dsdienthoai.get(i).getTendienthoai());
                        System.out.println(dsdienthoai.get(i).getGiaban());
                        System.out.println("-------------------------------");
                }
            }
            else
            {
                System.out.println("không có danh sách");
            }
       }*/

        
    }
}
